﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@algo-plus.co.uk website<http://www.algo-plus.co.uk/>
using System;
using FinPlusCompCore;
using FinPlusAssembler;
using FinPlusInterfaces;

namespace FinPlusCompAlgo
{
    public class AlgPlusStrategyOutright : FinPlusComponent
    {
        [State(Test = true)]
        public override bool IsValid { get; set; }

        //construct
        public AlgPlusStrategyOutright() 
        {
            IsValid = true;
        }

        //common control interface
        public override void CmdExecute(IPod command)
        {
            try
            {
                CmdCapture(command);
            }
            catch (CmdExecuteException e)
            {
                IsValid = Level.Error.Log(Id, Config, e.Message, e);
            }
        }

        public override void Dispose()
        {
            try
            {
                //TODO
            }
            catch (Exception e)
            {
                IsValid = Level.Warning.Log(e.Message, e);
            }
        }

    }
}
